#include <iostream>
#include <algorithm>
#include <cstdio>
#include <cstring>

using namespace std;

int main()
{
    int n, sum, x;
    while (cin >> n)
    {
        sum = x = 1;
        -- n;
        while (n > 0)
        {
            // 涨
            if (n >= x)
                sum += x;
            else
            {
                sum += n;
                break;
            }
            n -= x;

            // 跌
            x += 1;
            if (n > 0)
                sum -= 1;
            n -= 1;
        }
        cout << sum << endl;
    }
}
